package com.zyn.rsgl.controller;
import com.zyn.rsgl.pojo.SalaryAdjustment;
import com.zyn.rsgl.service.SalaryAdjustmentService;
import com.zyn.rsgl.utils.commonResult.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/rsgl/salary-adjustment")
public class SalaryAdjustmentController {
    @Resource
    private SalaryAdjustmentService salaryAdjustmentService;

    @PostMapping("/add")
    public R addAdjustment(@RequestBody SalaryAdjustment adjustment) {
        return salaryAdjustmentService.addAdjustment(adjustment);
    }

    @GetMapping("/list")
    public R getAdjustmentsByUserId(@RequestParam String userId) {
        return salaryAdjustmentService.getAdjustmentsByUserId(userId);
    }
}